﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;

namespace CMS.UI
{
    public class BundleConfig
    {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            //  ----- Scripts ------

            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js",
                        "~/Scripts/jquery.form.js",
                        "~/Scripts/jquery.friendurl.js",
                        "~/Scripts/jquery.scrollTo-1.4.3.1-min.js",
                        "~/Scripts/jquery.cookie.js",
                        "~/Scripts/jquery.elevatezoom.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryUI").Include(
                        "~/Scripts/jquery-ui-{version}.js"
                        //"~/Scripts/jquery-ui-timepicker.js"  <---  error in jqueryUI after bundling and minification
                        ));

            bundles.Add(new ScriptBundle("~/bundles/jqueryVal").Include(
                        "~/Scripts/jquery.validate*",
                        "~/Scripts/CMS/CustomValidation.js"));


            bundles.Add(new ScriptBundle("~/bundles/otherLibs").Include(
                        "~/Scripts/knockout-{version}.js",
                        "~/Scripts/underscore-min.js",
                        "~/Scripts/fullcalendar.js",
                        "~/Scripts/modernizr-*"));



            bundles.Add(new ScriptBundle("~/bundles/cms").Include(
                        "~/Scripts/CMS/Core.js",
                        "~/Scripts/CMS/MessageManager.js",
                        "~/Scripts/CMS/UI/Messages.js",
                        "~/Scripts/CMS/UI/TinyMCEManager.js",
                        "~/Scripts/CMS/UI/Admin/LeftMenuManager.js"));

            bundles.Add(new ScriptBundle("~/bundles/adminuser").Include(
                        "~/Scripts/CMS/UI/Admin/AdminUserManager.js"));

            bundles.Add(new ScriptBundle("~/bundles/usergroups").Include(
                        "~/Scripts/CMS/UI/Admin/UserGroupsManager.js"));

            bundles.Add(new ScriptBundle("~/bundles/domains").Include(
                        "~/Scripts/CMS/UI/Admin/DomainsManager.js"));

            bundles.Add(new ScriptBundle("~/bundles/adminmenu").Include(
                        "~/Scripts/CMS/UI/Admin/AdminMenuManager.js"));

            bundles.Add(new ScriptBundle("~/bundles/sections").Include(
                        "~/Scripts/CMS/UI/Admin/SectionManager.js"));

            bundles.Add(new ScriptBundle("~/bundles/news").Include(
                        "~/Scripts/CMS/UI/Admin/NewsManager.js"));

            bundles.Add(new ScriptBundle("~/bundles/testimonials").Include(
                        "~/Scripts/CMS/UI/Admin/TestimonialsManager.js"));

            bundles.Add(new ScriptBundle("~/bundles/forms").Include(
                        "~/Scripts/CMS/UI/Admin/FormManager.js"));

            bundles.Add(new ScriptBundle("~/bundles/formSubmissions").Include(
                        "~/Scripts/CMS/UI/Admin/FormSubmissionManager.js"));



            bundles.Add(new ScriptBundle("~/bundles/blogManager").Include(
                        "~/Scripts/CMS/UI/Web/BlogManager.js"));

            bundles.Add(new ScriptBundle("~/bundles/contactUsManager").Include(
                        "~/Scripts/CMS/UI/Web/ContactUsManager.js"));
    

            //  ----- Styles ------

            bundles.Add(new StyleBundle("~/Content/themes/base/ui.css").IncludeDirectory("~/Content/themes/base", "jquery-ui.*", false));

            bundles.Add(new StyleBundle("~/Content/admin/admin.css").Include(
                        "~/Content/reset.css",
                        "~/Content/admin/site.css"));

            bundles.Add(new StyleBundle(String.Format("~/Content/{0}/web.css", SettingsManager.WebTheme)).Include(
                        "~/Content/reset.css",
                        String.Format("~/Content/{0}/site.css", SettingsManager.WebTheme)));
        }
    }
}